from imposm.parser import OSMParser

# simple class that handles the parsed OSM data.
class XMLscraper(object):
   a=[]
   def nodes(self,nodes):
       file1=open("latlon.b","a") 
       for osm_id,tags,lat in nodes:
		if "addr:street" in tags.keys():
                    print tags['addr:street']
      
       
       file1.close()                   
        
# instantiate counter and parser and start parsin'g

scraper = XMLscraper()

p = OSMParser(concurrency=1, nodes_callback=scraper.nodes)

p.parse('london.osm')
#scraper.a=list(set(scraper.a))
#for i in scraper.a:
#    print i



